package com.situ.day11;

import java.lang.String;

public class TryCatchFinally {
    static int x = 1;
    static int y = 10;
    static int z = 100;

    public static void main(String[] args) {
        int value = finallyReturn();
        System.out.println("value=" + value);

        System.out.println("x=" + x);// 2
        System.out.println("y=" + y);// 10
        System.out.println("z=" + z);// 101
    }
    private static int finallyReturn() {
        try {
            // ...
            return ++x;
        } catch (Exception e) {
            return ++y;
        } finally {
            return ++z;
        }
    }
}
